import java.util.Scanner;

class node {
    public int val;
    public node next;
    public node(int val) {
        this.val = val;
    }
}
public class day230420 {
    // 猴子分桃
    public static void main3(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) {
            int n = in.nextInt();
            if (n == 0) {
                break;
            }
            long a = (long)Math.pow(5, n) - 4;
            long b = (long)Math.pow(4, n) + n - 4;
            System.out.println(a + " " + b);
        }
    }


    // 反转部分单链表
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        in.nextLine(); // 吃掉回车
        String[] arr = in.nextLine().split(" ");
        // 遍历数组, 创建链表
        // 头节点
        node head = new node(-1);
        // 记录尾节点
        node rear = head;
        for (int i = 0; i < n; i++) {
            rear.next = new node(Integer.parseInt(arr[i]));
            rear = rear.next;
        }
        int left = in.nextInt();
        int right = in.nextInt();
        // 反转
        reverse(head, left, right);
        // 打印
        for (int i = 0; i < n; i++) {
            head = head.next;
            System.out.print(head.val + " ");
        }
    }
    private static void reverse(node head, int left, int right) {
        // 找到反转区间的前驱节点
        node prev = head;
        for (int i = 1; i < left; i++) {
            prev = prev.next;
        }
        // 反转区间的第一个节点
        node cur = prev.next;
        // 反转
        for (int i = left; i < right; i++) {
            // 标记当前操作的节点
            node tmp = cur.next;
            // 将这个节点从链表中删除
            cur.next = tmp.next;
            // 将这个节点尾插在 prev 后
            tmp.next = prev.next;
            prev.next = tmp;
        }
    }


    // 不合题意
    public static void main2(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        int left = sc.nextInt() - 1;
        int right = sc.nextInt() - 1;
        while (left < right) {
            int tmp = arr[left];
            arr[left] = arr[right];
            arr[right] = tmp;
            left++;
            right--;
        }
        for (int i = 0; i < n; i++) {
            System.out.print(arr[i] + " ");
        }
    }

    // 选择题
    public static void main1(String[] args) {
        int i = 5;
        int s = (i++)+(++i)+(i--)+(--i);
        // 5 + 7 + 7 + 5
        System.out.println(s);// 24
    }
}
